﻿using MvCamCtrl.NET;
using MvCameraControl;
using Platform.Hardware.Camera.Base;
using Platform.Logger;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Platform.Hardware.Camera.Hik
{
    public class CameraHik_CU060_10GC : ICamera
    {
       
        private MyCamera MyCamera { get; }
        private MyCamera.MV_CC_DEVICE_INFO MV_CC_DEVICE_INFO;
        private MyCamera.cbOutputExdelegate MyCameraHandler;
        private IntPtr intPtr = IntPtr.Zero;
        private CameraConfig config;
        private AutoResetEvent wait = new AutoResetEvent(false);
        public CameraHik_CU060_10GC()
        {
            MyCamera = new MyCamera();
           
        }
        public int Width { get; } = 2448;
        public int Height { get; } = 2048;

        public bool Initialized { get; set; }

        public bool Connected { get; set; }

        public string Message { get; set; }

        public void Close()
        {
            try
            {
                
                int result = MyCamera.MV_CC_CloseDevice_NET();
                if (result != MyCamera.MV_OK)
                {
                    Logs.LogError($"IP为{config.IpAddress}的海康相机关闭失败");
                }
                else
                {
                    Logs.LogError($"IP为{config.IpAddress}的海康相机关闭成功");

                }
            }
            catch (Exception ex)
            {
                Logs.LogError(ex.ToString());
            }
        }

        public float GetExposureTime()
        {
            throw new NotImplementedException();
        }

        public float GetGain()
        {
            throw new NotImplementedException();
        }

        public bool Init(CameraConfig cameraConfig)
        {
            throw new NotImplementedException();
        }

        public bool Load(string filename)
        {
            throw new NotImplementedException();
        }

        public bool SetExposureTime(float value)
        {
            throw new NotImplementedException();
        }

        public bool SetGain(float value)
        {
            throw new NotImplementedException();
        }

        public bool Trigger()
        {
            throw new NotImplementedException();
        }
    }
}
